package com.huan.controller;

import com.huan.VO.AddArticleDto;
import com.huan.VO.PageVo;
import com.huan.domain.ResponseResult;
import com.huan.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/content/article")
public class ArticleController {

    @Autowired
    private ArticleService articleService;

    @PostMapping
    public ResponseResult add(@RequestBody AddArticleDto article){
        return articleService.add(article);
    }
    @GetMapping("/list")
    public ResponseResult getAllList(Integer pageNum, Integer pageSize, String title, String summary){
        return articleService.getAllList(pageNum,pageSize,title,summary);
    }
    @GetMapping("{id}")
    public ResponseResult getList(@PathVariable Long id){
        return articleService.getList(id);
    }
    @DeleteMapping("{id}")
    public ResponseResult deleteList(@PathVariable Long id){
        return articleService.deleteList(id);
    }


















}
